package com.ram.controller;

import com.ram.pojo.RepairType;
import com.ram.pojo.Result;
import com.ram.service.RepairTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/repair/type")
public class RepairTypeController {
    @Autowired
    private RepairTypeService service;
    @GetMapping("/list")
    public Result list() { return Result.success(service.list()); }
    @GetMapping("/{id}")
    public Result getById(@PathVariable Integer id) { return Result.success(service.getById(id)); }
    @PostMapping
    public Result add(@RequestBody RepairType type) { service.add(type); return Result.success(); }
    @PutMapping
    public Result update(@RequestBody RepairType type) { service.update(type); return Result.success(); }
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Integer id) { service.deleteById(id); return Result.success(); }
} 